<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>设备类型管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('<spring:message code="common.subbmiting"/>');
                    timeVali($("#btnSubmit"));
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/equipment/eleEquipmentType/"><spring:message code="menu.device.Equipment_Type_List"/></a></li>
		<li class="active">
            <a href="${ctx}/equipment/eleEquipmentType/form?id=${eleEquipmentType.id}">
                <shiro:hasPermission name="equipment:eleEquipmentType:edit">
					<c:if test="${not empty eleEquipmentType.id}">
						<spring:message code="devicetype.modify"/>
					</c:if>
					<c:if test="${empty eleEquipmentType.id}">
						<spring:message code="menu.device.Equipment_Type_Add"/>
					</c:if>
					</shiro:hasPermission>
                <shiro:lacksPermission name="equipment:eleEquipmentType:edit">
					<spring:message code="devicetype.info"/>
				</shiro:lacksPermission>
            </a>
        </li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="eleEquipmentType" action="${ctx}/equipment/eleEquipmentType/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label"><spring:message code="common.dname"/>：</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="200" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label"><spring:message code='common.resolution'/>：</label>
			<div class="controls">
				<form:input path="width" htmlEscape="false" maxlength="255" class="input-mini digits required" />				
				*
				<form:input path="height" htmlEscape="false" maxlength="255" class="input-mini digits required"/>
								<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<c:if test="${language == 'zh'}">
		<div class="control-group">
			<label class="control-label"><spring:message code="device.orientation"/>：</label>
			<div class="controls">
			 	<form:select path="orientation" >
                    <form:options items="${fns:getDictList('orientation')}" itemLabel="label" itemValue="value" htmlEscape="false" class="input-small" />
                </form:select>
			</div>
		</div>
		</c:if>
		<c:if test="${language == 'en'}">
		<div class="control-group">
			<label class="control-label"><spring:message code="device.orientation"/>：</label>
			<div class="controls">
			 	<form:select path="orientation" >
                    <form:options items="${fns:getDictList('orientation')}" itemLabel="enlabel" itemValue="value" htmlEscape="false" class="input-small" />
                </form:select>
			</div>
		</div>
		</c:if>
		<div class="control-group">
			<label class="control-label"><spring:message code="type"/>：</label>
			<div class="controls">
				<form:input path="model" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
								<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label"><spring:message code='common.remarks'/>：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		
		<div class="form-actions">
			<shiro:hasPermission name="equipment:eleEquipmentType:edit">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="<spring:message code='common.save'/>"/>&nbsp;
			</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="<spring:message code='common.back'/>" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>